#pragma once

#include <gofcl_rcu_rstsck.h>

typedef struct {
	u8_s irc40k_en : 1;
	u8_s : 7;
} rcu_rstsck_0_7_write_expl_s;

// 开启或关闭IRC40K时钟
static inline void rcu_irc40k_en_di(rcu_rstsck_0_7_write_expl_s rstsck_0_7) {
	union {
		rcu_rstsck_0_7_write_expl_s e;
		rcu_rstsck_0_7_s r;
	} er = {
		.e = rstsck_0_7,
	};
	rcu_wreg_rstsck_0_7_s(er.r);
}

typedef struct {
	u8_s : 1;
	u8_s irc40k_stb : 1;
	u8_s : 6;
} rcu_rstsck_0_7_read_expl_s;

// 查看IRC40K时钟是否已稳定
static inline rcu_rstsck_0_7_read_expl_s rcu_irc40k_is_stb(void) {
	union {
		rcu_rstsck_0_7_read_expl_s e;
		rcu_rstsck_0_7_s r;
	} er = {
		.r = rcu_rreg_rstsck_0_7_s(),
	};
	return er.e;
}
